package com.mmz.test.activemq;

import org.springframework.jms.listener.SessionAwareMessageListener;

import javax.jms.*;

public class MyMessageListener implements SessionAwareMessageListener {

    @Override
    public void onMessage(Message message, Session session) throws JMSException {
        try{
            TextMessage textMessage = (TextMessage) message;
            System.out.println(textMessage.getText());
            message.acknowledge();
        }
        catch (Exception e){
            e.printStackTrace();
        }
    }
}
